package jiangyeheng.first;

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner =new Scanner(System.in);
        Circle circle=new Circle();
        circle.setRadius(scanner.nextDouble()) ;
        System.out.println("这个圆的周长为"+circle.getPerimeter());
        System.out.println("这个圆的面积为"+circle.getArea());
        Rectangle rectangle=new Rectangle();
        rectangle.setHeight(scanner.nextDouble());
        rectangle.setWidth(scanner.nextDouble());
        System.out.println("这个长方形的面积为"+rectangle.getArea());
        GeometricObject geometricObject=new GeometricObject();
        geometricObject.setColor("蓝色");
        geometricObject.isFilled();
        geometricObject.setFilled(true);
        geometricObject.toString();

    }
}
class GeometricObject{
    public String color;
    public Boolean filled;

    public GeometricObject() {
        this.color = "white";
        this.filled = false;
    }
    public GeometricObject(String color, Boolean filled) {
        this.color = color;
        this.filled = filled;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public void setFilled(Boolean filled) {
        this.filled = filled;
    }
    public boolean isFilled(){
        return false;
    }

    public String toString(){
        return "这个图形颜色为"+color+"填充情况为"+filled;
    }

    public double getArea(){
        return 0.0;
    }

    public double getPerimeter(){
        return 0.0;
    }
}
class Circle extends GeometricObject{
    public double radius;

    public Circle() {
        this.radius=0.0;
    }

    public Circle(double radius) {
        this.radius = radius;
    }

    public Circle(String color, Boolean filled, double radius) {
        super(color, filled);
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return Math.PI*radius*radius;
    }

    @Override
    public double getPerimeter() {
        return 2*Math.PI*radius;
    }

}
class Rectangle extends GeometricObject{
    double width;
    double height;

    public double getHeight() {

        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public Rectangle() {
        this.height = 0.0;
        this.width = 0.0;
    }

    public Rectangle(double height, double width) {
        this.height = height;
        this.width = width;
    }

    public Rectangle(String color, Boolean filled, double height, double width) {
        super(color, filled);
        this.height = height;
        this.width = width;
    }

    @Override
    public double getArea() {
        return width*height;
    }
}